using System; 
using System.Collections.Generic; 
using System.Text; 
using FluentNHibernate.Mapping;
using Managistics.Model; 

namespace Managistics.Model.Mappings {
    
    
    public class EmployeesMap : ClassMap<Employees> {
        
        public EmployeesMap() {
			Table("EMPLOYEES");
			LazyLoad();
			Id(x => x.Employeeid).GeneratedBy.Assigned().Column("EMPLOYEEID");
			References(x => x.City).Column("CITYID");
			Map(x => x.Lastname).Column("LASTNAME").Not.Nullable().Length(30);
			Map(x => x.Firstname).Column("FIRSTNAME").Not.Nullable().Length(20);
			Map(x => x.Sex).Column("SEX").Not.Nullable();
			Map(x => x.MobileEmployees).Column("MOBILE_EMPLOYEES").Length(20);
			Map(x => x.EmailCompany).Column("EMAIL_COMPANY").Length(30);
			Map(x => x.OfficePhone).Column("OFFICE_PHONE").Length(20);
			Map(x => x.Status).Column("STATUS").Not.Nullable();
			Map(x => x.Positions).Column("POSITIONS").Length(20);
			Map(x => x.Department).Column("DEPARTMENT").Length(20);
			Map(x => x.DateHired).Column("DATE_HIRED").Not.Nullable();
			HasMany(x => x.Account).KeyColumn("EMPLOYEEID");
			HasMany(x => x.Decentralization).KeyColumn("EMPLOYEEID");
			HasMany(x => x.OrderCustomers).KeyColumn("EMPLOYEEID");
			HasMany(x => x.OrderNhanhNhanh).KeyColumn("EMPLOYEEID");
        }
    }
}
